package cn.smxy.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("plant_family")
public class PlantFamily implements Serializable {
    private static final long serialVersionUID = 104670734257714985L;

    @TableId(type = IdType.ASSIGN_ID,value = "family_id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long familyId;

    @NotBlank
    private String familyName;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    @NotNull
    @JsonSerialize(using = ToStringSerializer.class)
    private Long categoryId;
}
